package com.uzai.common.enums;

public enum MerEsDataIndexName {
    UZAI_WX_CONTACTS("uzai_wx_contacts","微信通讯录"),
    UZAI_WX_GROUP_MEMBER("uzai_wx_group_member","群成员"),
    UZAI_GROUP_SEND_MSG("uzai_group_send_msg","群发消息"),
    UZAI_PYQ_JOB_DETAIL("uzai_pyq_job_detail","朋友圈");

    private String value;
    private String desc;
    MerEsDataIndexName(String value, String desc) {
        this.value = value;
        this.desc = desc;
    }
    public static final String UZAI_WX_CONTACTS_VALUE = "uzai_wx_contacts";
    public static final String UZAI_WX_GROUP_MEMBER_VALUE = "uzai_wx_group_member";
    public static final String UZAI_GROUP_SEND_MSG_VALUE = "uzai_group_send_msg";
    public static final String UZAI_PYQ_JOB_DETAIL_VALUE = "uzai_pyq_job_detail";

    public String getValue() {
        return value;
    }
    public String getDesc() {
        return desc;
    }
    public static MerEsDataIndexName getValue(String value) {
        if (value == null) {
            return null;
        }
        for (MerEsDataIndexName type: MerEsDataIndexName.values()) {
            if (type.getValue().equals(value) ) {
                return type;
            }
        }
        return null;
    }
    public static String getDesc(String value) {
        if(getValue(value) == null){
            return null;
        }
        return getValue(value).getDesc();
    }
}
